<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:87:"E:\phpstudy\PHPTutorial\WWW\clouds\public/../application/admin\view\phone\phoneSel.html";i:1541350462;}*/ ?>

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>layui</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="/static/admin/layui/css//layui.css"  media="all">
  <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<body>
<form class="layui-form layui-form-pane" action="">
  <blockquote class="layui-elem-quote layui-text">
  </blockquote>

  <div class="layui-form-item">
  <label class="layui-form-label">手机号码</label>
  <div class="layui-input-inline">
    <input type="text" name="telphone"id="telphone" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
  </div>
</div>
  <div class="layui-form-item">
    <label class="layui-form-label">真实姓名</label>
    <div class="layui-input-inline">
      <input type="text" name="cname" id="cname"lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">身份证号</label>
    <div class="layui-input-inline">
      <input type="text" name="idcard" id="idcard" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
    </div>
  </div>

  <div class="layui-form-item">
    <button class="layui-btn" lay-submit="" lay-filter="demo1">跳转式提交</button>
  </div>
</form>

<script src="/static/admin/layui/layui.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
layui.use(['form', 'layedit', 'laydate'], function() {
    var form = layui.form
        , layer = layui.layer
        , layedit = layui.layedit
        , laydate = layui.laydate;

    //日期
    laydate.render({
        elem: '#date'
    });
    laydate.render({
        elem: '#date1'
    });

    //创建一个编辑器
    var editIndex = layedit.build('LAY_demo_editor');

    //自定义验证规则
    form.verify({
        title: function (value) {
            if (value.length < 5) {
                return '标题至少得5个字符啊';
            }
        }
        , pass: [/(.+){6,12}$/, '密码必须6到12位']
        , content: function (value) {
            layedit.sync(editIndex);
        }
    });
    var $ = layui.$ //重点处
        , layer = layui.layer;
    //监听提交
    form.on('submit(demo1)', function (data) {
        var telphone = $("#telphone").val();
        var cname = $("#cname").val();
        var idcard = $("#idcard").val();
        //console.log(telphone,cname,idcard);
        $.ajax({
            url: '/admin/Phone/phoneList',
            dataType: 'json',
            type: 'post',
            // async:false,
            data: {'telphone': telphone, 'cname': cname, 'idcard': idcard},
            success: function (data) {
                layer.alert(JSON.stringify(data.field));
            }
        });
        return false;
    });
});
</script>

</body>
</html>